home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / zpont311.lha / zpoint-3.11 / Rexx / RemoveRevoked.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-09  |  1KB  |  56 lines

  1. /*
  2.     RemoveRevoked.rexx 1.0 (28.10.94) Copyright (c) Ralph Seichter
  3.  
  4.     Interactively delete all revoked keys from public key ring.
  5.     Requires PGP Amiga V2.3a.5 and GNU grep.
  6. */
  7.  
  8. pgp  = 'C:pgp'   /* Adapt paths to your personal needs */
  9. grep = 'C:grep'
  10.  
  11. tmp1 = 'T:rmrevok.tmp1'
  12. tmp2 = 'T:rmrevok.tmp2'
  13. tmp3 = 'T:rmrevok.tmp3'
  14.  
  15. /***** PLEASE DO NOT CHANGE ANYTHING BELOW THIS LINE *********************/
  16.  
  17. options results
  18. address command
  19. pgp' -kv >'tmp1
  20.  
  21. say 'Searching for revoked keys'
  22. grep' REVOK <'tmp1' >'tmp2
  23.  
  24. err = 1
  25. if OPEN(infile, tmp2, 'R') then do
  26.     if OPEN(outfile, tmp3, 'W') then do
  27.         err = 0
  28.         more = 1
  29.         do while (more & ~err)
  30.             line = READLN(infile)
  31.             if line ~= '' then do
  32.                 key = SUBSTR(line, 11, 8)
  33.                 line = pgp' -kr 0x'key
  34.                 if WRITELN(outfile, line) < 10 then do
  35.                     err = 1
  36.                 end
  37.             end
  38.             else
  39.                 more = 0
  40.         end
  41.         more = CLOSE(outfile)
  42.     end
  43.     else
  44.         say "Can't open "tmp3" for writing!"
  45.     more = CLOSE(infile)
  46. end
  47. else
  48.     say "Can't open "tmp2" for reading!"
  49.  
  50. if ~err then
  51.    'execute 'tmp3
  52.  
  53. 'delete 'tmp1' 'tmp2' 'tmp3' quiet'
  54.  
  55. /* EOF */
  56.